open(BUFF,"ids.txt") or die "no file exists ids.txt\n";
while(<BUFF>)
{
	chomp($_);
	@array=split("\t",$_);
	$hash{$array[1]}=$array[3];	
}
close(BUFF);
open(TFAM,"SNPS2882.tfam") or die "no file found SNPS2882.tfam\n";
open(WRTFAM,">SNPS2882_temp.tfam") or die "no file found SNPS2882.tfam\n";
while(<TFAM>)
{
	@array=split(" ",$_);
	if(exists($array[1]))
	{
		$array[0] = $hash{$array[1]};
		$array[1] = $hash{$array[1]};
		$_ = join(" ",@array);
		print WRTFAM $_."\n";
	}
}
close(TFAM);
close(WRFAM);
